{extend name="public:base"}
{block name='css'}
{/block}
<style>

</style>
{block name='body'}
<div class="view view-main white-navbar white-toolbar">
    <div data-name="home" class="page">

        <div class="navbar">
            <div class="navbar-inner">
                <div class="left"><a href="{$back}" class="external"><i class="iconfont icon-fanhui"></i></a></div>
                <div class="center"><span>推广二维码</span></div>
                <div class="right"><a class="xqrcode" onclick="qrCode();" style="font-size: 12px !important;
                    color: #66ba61 !important;
                    line-height: 22px !important;">重新生成<i class="iconfont icon-erweima"></i></a></div>
            </div>
        </div>

        <div class="page-content">

            <!--<p class="row segmented-round" style="display:block;width:auto;margin:100px 20px 20px 20px;">-->
                <!--<button onclick="qrCode();" class="col button button-big button-fill button-round" style="background:#66ba61;">点此生成推广二维码</button>-->
            <!--</p>-->

            <div class="tui">
                <img src="/qrcode/invite/{:session('user.id')}.png?{:time()}" />
            </div>

        </div>


    </div>
</div>
{/block}

{block name="js"}
<script>
    //重新生成二维码
    function qrCode()
    {
        app.dialog.preloader('请稍后...');
        $.post( "{:url('reSaveQrcode')}" , {}, function ( data ) {
            if ( data.status == 'y' ) {
                $('.tui img').attr('src', "/qrcode/invite/{:session('user.id')}.png?"+Math.random());
            }
            messageToast( data.info ) ;
            app.dialog.close();
        }, "json");
    }
</script>
{/block}